#Author: Michiel van der Coelen
#date: 2012-06-05
#tabsize: 4 
 
NAME = main
CFLAGS = -I. -I../usbdrv
USBLIBS := $(shell libusb-config --libs)
CC = gcc
OUTPUTNAME = $(NAME) 
OBJECTS = opendevice.o usbfunctions.o
MATLAB= singleRun

matlab:$(MATLAB)

$(MATLAB):$(OBJECTS) $(MATLAB).o
	$(CC) -o $(MATLAB) $(OBJECTS) $(MATLAB).o $(USBLIBS)

.PHONY:all, clean, force

all:$(OUTPUTNAME)


force:clean all

$(OUTPUTNAME):$(OBJECTS) $(NAME).o
	$(CC) -o $(OUTPUTNAME) $(OBJECTS) $(NAME).o $(USBLIBS)

clean:
	rm $(OBJECTS) $(NAME).o
	rm $(OUTPUTNAME)

%.o:%.c
	$(CC) $(CFLAGS) -c $< -o $@
